package com.learning.servlet3x.context;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * ClassName: DynamicServlet
 * Description: 动态添加的Servlet，既没有web.xml 标签配置，也没有@WebServlet 注解
 * 访问地址：http://localhost:8080/dynamic/dynamicServlet
 * <p>
 * Date: 2014/12/06 22:03 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
public class DynamicServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("动态添加的Servlet，既没有web.xml 标签配置，也没有@WebServlet 注解");
        System.out.println("动态添加的Servlet 初始化参数： " + getInitParameter("user"));
    }
}
